<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>批发增加修改</title>
<link rel="stylesheet" href="../../res/layui/css/layui.css">
<script type="text/javascript"
	src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
	<form id="form" class="layui-form"
		action="../../listenMember/addOrUpdate.action" method="post"
		style="margin-top: 10px;">
		<input type="hidden" id="id" class="memberId" name='memberId'/>
		<div class="layui-form-item layui-form-text" style="width: 70%;">
			<label class="layui-form-label">会员名称:</label>
			<div class="layui-input-block">
				<input name="memberName" lay-verify="required|bwTimeString"
					placeholder="请输入会员名称" class="layui-input" id='memberName' />
			</div>
		</div>
		<div class="layui-form-item layui-form-text" style="width: 70%;">
			<label class="layui-form-label">会员密码:</label>
			<div class="layui-input-block">
				<input name="memberPwd" lay-verify="required|bwTimeString"
					placeholder="请输入会员密码" class="layui-input" id='memberPwd' />
			</div>
		</div>
		<div class="layui-form-item" style="width: 70%;">
			<label class="layui-form-label">电话号码:</label>
			<div class="layui-input-block">
				<input name="memberPhone" lay-verify=required|bwPrice " 
				lay-autocomplete="off" placeholder="请输入电话号码" class="layui-input"
				type="text" id='memberPhone'>
			</div>
		</div>
		<div class="layui-form-item" style="width: 70%;">
			<label class="layui-form-label">会员性别:</label>
			<div class="layui-input-block">
				<select class="layui-input" name="memberSex" id="memberSex"
					lay-verify="required|companyId">
					<option value="">-请选择性别-</option>
					<option value="男">-男-</option>
					<option value="女">-女-</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item" style="width: 70%;">
			<label class="layui-form-label">会员等级:</label>
			<div class="layui-input-block">
				<select class="layui-input" name="memberGrade" id="memberGrade"
					lay-verify="required|memberGrade">
					<option value="">-请选择-</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item" style="width: 70%;">
			<label class="layui-form-label">是否有效:</label>
			<div class="layui-input-block">
				<select class="layui-input" name="isva" id="isva"
					lay-verify="required">
					<option value="">-请选择-</option>
					<option value="1">有效</option>
					<option value="0">无效</option>
				</select>
			</div>
		</div>

		<br />
		<div class="layui-form-item" style="width: 70%;">
			<div class="layui-input-block">
				<button class="layui-btn" lay-submit lay-filter="formDemo" id="sub">立即提交</button>
			</div>
		</div>
	</form>
	<script src="../../res/layui/layui.all.js" charset="utf-8"></script>
	<script>
layui.use(['form', 'layedit'], function(){
  var form = layui.form, layer = layui.layer, layedit = layui.layedit;
	 
				$("#memberGrade").append("<option value='1'>普通会员</option>");
			 
				$("#memberGrade").append("<option value='2'>银牌会员</option>");
			 
				$("#memberGrade").append("<option value='3'>金牌会员</option>");
			 
			form.render();
	 
  
  //创建一个编辑器
  var editIndex = layedit.build('LAY_demo_editor');
 
  //自定义验证规则
  form.verify({
	  routeContent: function(value){
      if(value.length < 2 || value.length>6){
        return '内容不能少于2个字符和大于6个字符';
      }
    }
   
  });
     
//监听提交
  form.on('submit(formDemo)', function(data){
	  var index=parent.layer.getFrameIndex(window.name);
	  parent.layer.close(index);
  });
   
 
 
  
});
layui.use('upload', function(){
	  var $ = layui.jquery
	  ,upload = layui.upload;
	  
	  
	
});
function load(){
	var form = layui.form;
	form.render();
}
</script>
</body>
</html>